﻿using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace WebApiTest.Dto.Utils
{
    public class PagingDTO
    {
        public int pageNo { get; set; }
        public int pageSize { get; set; }
        public long totalCount { get; set; }
        public int totalPage { get; set; }
        public List<JObject> data { get; set; }

        public PagingDTO() {}

        public PagingDTO(int pageNo, int pageSize, long totalCount, List<JObject> data)
        {
            this.pageNo = pageNo;
            this.pageSize = pageSize;
            this.totalCount = totalCount;
            this.totalPage = (int)Math.Ceiling(totalCount * 1.0 / pageSize);
            this.data = data;
        }
    }
}
